// 1-12 实例-12 求一元二次方程根
/**
 * ax^2 + bx +c = 0;
 * x = (-b ± √(b^2 - 4ac))/2a
 */
#include <iostream>
#include <cmath>
int main(void)
{

  int a, b, c;
  std::cout << "请输入a,b,c:";
  std::cin >> a >> b >> c;

  float x1, x2;
  x1 = (float)(-b) / (2 * a) + (float)sqrt(pow(b, 2) - 4 * a * c) / (2 * a);
  x2 = (float)(-b) / (2 * a) - (float)sqrt(pow(b, 2) - 4 * a * c) / (2 * a);

  std::cout << "x1:" << x1 << std::endl;
  std::cout << "x2:" << x2 << std::endl;
  printf("---------------end-----------------\n");
  return 0;
}